package com.cms.attachment.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cms.attachment.mapper.CmsAttachmentMapper;
import com.cms.attachment.domain.CmsAttachment;
import com.cms.attachment.service.ICmsAttachmentService;

/**
 * 文章附件Service业务层处理
 * 
 * @author rjxy
 * @date 2025-09-29
 */
@Service
public class CmsAttachmentServiceImpl implements ICmsAttachmentService 
{
    @Autowired
    private CmsAttachmentMapper cmsAttachmentMapper;

    /**
     * 查询文章附件
     * 
     * @param id 文章附件主键
     * @return 文章附件
     */
    @Override
    public CmsAttachment selectCmsAttachmentById(Long id)
    {
        return cmsAttachmentMapper.selectCmsAttachmentById(id);
    }

    /**
     * 查询文章附件列表
     * 
     * @param cmsAttachment 文章附件
     * @return 文章附件
     */
    @Override
    public List<CmsAttachment> selectCmsAttachmentList(CmsAttachment cmsAttachment)
    {
        return cmsAttachmentMapper.selectCmsAttachmentList(cmsAttachment);
    }

    /**
     * 新增文章附件
     * 
     * @param cmsAttachment 文章附件
     * @return 结果
     */
    @Override
    public int insertCmsAttachment(CmsAttachment cmsAttachment)
    {
        return cmsAttachmentMapper.insertCmsAttachment(cmsAttachment);
    }

    /**
     * 修改文章附件
     * 
     * @param cmsAttachment 文章附件
     * @return 结果
     */
    @Override
    public int updateCmsAttachment(CmsAttachment cmsAttachment)
    {
        return cmsAttachmentMapper.updateCmsAttachment(cmsAttachment);
    }

    /**
     * 批量删除文章附件
     * 
     * @param ids 需要删除的文章附件主键
     * @return 结果
     */
    @Override
    public int deleteCmsAttachmentByIds(Long[] ids)
    {
        return cmsAttachmentMapper.deleteCmsAttachmentByIds(ids);
    }

    /**
     * 删除文章附件信息
     * 
     * @param id 文章附件主键
     * @return 结果
     */
    @Override
    public int deleteCmsAttachmentById(Long id)
    {
        return cmsAttachmentMapper.deleteCmsAttachmentById(id);
    }
}
